package jsyf.oa.entity.weekplan;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by LT on 2018/3/19.
 */
@Entity
@Table(name = "T_WRT_WEEK_PLAN", schema = "oa", catalog = "")
public class WeekPlanEntity extends BaseEntity {
    private String customerName;
    private String lastVisitTime;
    private String customerAddress;
    private String intentionDevice;
    private String remake;
    private String createUserId;
    private String weekTime;
    private String customerIndustry;
    private String weekName;

    public String getCustomerIndustry() {
        return customerIndustry;
    }

    public void setCustomerIndustry(String customerIndustry) {
        this.customerIndustry = customerIndustry;
    }

    public String getWeekName() {
        return weekName;
    }

    public String getLastVisitTime() {
        return lastVisitTime;
    }

    public void setLastVisitTime(String lastVisitTime) {
        this.lastVisitTime = lastVisitTime;
    }

    public String getWeekTime() {
        return weekTime;
    }

    public void setWeekTime(String weekTime) {
        this.weekTime = weekTime;
    }

    public void setWeekName(String weekName) {
        this.weekName = weekName;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }


    public String getCustomerAddress() {
        return customerAddress;
    }

    public void setCustomerAddress(String customerAddress) {
        this.customerAddress = customerAddress;
    }

    public String getIntentionDevice() {
        return intentionDevice;
    }

    public void setIntentionDevice(String intentionDevice) {
        this.intentionDevice = intentionDevice;
    }

    public String getRemake() {
        return remake;
    }

    public void setRemake(String remake) {
        this.remake = remake;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }



    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("CUSTOMER_NAME" ,this.getCustomerName());
        obj.put("LAST_VISIT_TIME",this.getLastVisitTime());
        obj.put("CUSTOMER_ADDRESS",this.getCustomerAddress());
        obj.put("INTENTION_DEVICE",this.getIntentionDevice());
        obj.put("REMAKE",this.getRemake());
        obj.put("CREATE_USER_ID",this.getCreateUserId());
        obj.put("CREATE_TIME",this.getCreateTime());
        obj.put("WEEK_TIME",this.getWeekTime());
        obj.put("CUSTOMER_INDUSTRY",this.getCustomerIndustry());
        obj.put("WEEK_NAME",this.getWeekName());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_WRT_WEEK_PLAN";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("CUSTOMER_NAME" ,"customerName");
        obj.put("LAST_VISIT_TIME","lastVisitTime");
        obj.put("CUSTOMER_ADDRESS","customerAddress");
        obj.put("INTENTION_DEVICE","intentionDevice");
        obj.put("REMAKE","remake");
        obj.put("CREATE_USER_ID","createUserId");
        obj.put("CREATE_TIME","createTime");
        obj.put("WEEK_TIME","weekTime");
        obj.put("CUSTOMER_INDUSTRY","customerIndustry");
        obj.put("WEEK_NAME","weekName");
        return obj;
    }

    @Override
    public String toString() {
        return "WeekPlanEntity{" +
                "id='" + id + '\'' +
                ", delFlag=" + delFlag +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", customerName='" + customerName + '\'' +
                ", lastVisitTime=" + lastVisitTime +
                ", customerAddress='" + customerAddress + '\'' +
                ", intentionDevice='" + intentionDevice + '\'' +
                ", remake='" + remake + '\'' +
                ", createUserId='" + createUserId + '\'' +
                ", weekTime=" + weekTime +
                ", customerIndustry='" + customerIndustry + '\'' +
                ", weekName='" + weekName + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WeekPlanEntity that = (WeekPlanEntity) o;

        if (!customerName.equals(that.customerName)) return false;
        if (!lastVisitTime.equals(that.lastVisitTime)) return false;
        if (!customerAddress.equals(that.customerAddress)) return false;
        if (!intentionDevice.equals(that.intentionDevice)) return false;
        if (!remake.equals(that.remake)) return false;
        if (!createUserId.equals(that.createUserId)) return false;
        if (!weekTime.equals(that.weekTime)) return false;
        if (!customerIndustry.equals(that.customerIndustry)) return false;
        return weekName.equals(that.weekName);
    }

    @Override
    public int hashCode() {
        int result = customerName.hashCode();
        result = 31 * result + lastVisitTime.hashCode();
        result = 31 * result + customerAddress.hashCode();
        result = 31 * result + intentionDevice.hashCode();
        result = 31 * result + remake.hashCode();
        result = 31 * result + createUserId.hashCode();
        result = 31 * result + weekTime.hashCode();
        result = 31 * result + customerIndustry.hashCode();
        result = 31 * result + weekName.hashCode();
        return result;
    }
}
